import cv2 as cv


filename = r'E:\images\lena.jpg'
img = cv.imread(filename)

#均值滤波
ave = cv.blur(img, (5, 5))
cv.imshow("Ave", ave)
#高斯滤波
dst = cv.GaussianBlur(img, (3, 3), 0)
cv.imshow("Gaosi", dst)
#中值滤波
mid = cv.medianBlur(img, 3)
cv.imshow("mid", mid)


cv.waitKey()
cv.destroyAllWindows()